// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@use "refactor/common-refactor.scss" as deprecated;

.main-toolbar {
  cursor: initial;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-direction: column;
  height: deprecated.$s-56;
  padding: deprecated.$s-8 deprecated.$s-16;
  border-radius: deprecated.$s-8;
  border: deprecated.$s-2 solid var(--panel-border-color);
  z-index: deprecated.$z-index-3;
  background-color: var(--color-background-primary);
  transition:
    top 0.3s,
    height 0.3s,
    opacity 0.3s;

  --toolbar-position-y: #{deprecated.$s-28};
  --toolbar-offset-y: 0px;
  top: calc(var(--toolbar-position-y) + var(--toolbar-offset-y));
}

.main-toolbar-no-rulers {
  --toolbar-position-y: 0px;
  --toolbar-offset-y: #{deprecated.$s-8};
}

.main-toolbar-hidden {
  --toolbar-offset-y: -#{deprecated.$s-4};
  height: deprecated.$s-16;
  z-index: deprecated.$z-index-1;
  border-radius: 0 0 deprecated.$s-8 deprecated.$s-8;
  border-block-start: 0;

  .main-toolbar-options {
    opacity: deprecated.$op-0;
    visibility: hidden;
  }
}

.main-toolbar-options {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  opacity: deprecated.$op-10;
  transition: opacity 0.3s ease;

  li {
    position: relative;
  }
}

.main-toolbar-options-button {
  @extend .button-tertiary;
  height: deprecated.$s-36;
  width: deprecated.$s-36;
  flex-shrink: 0;
  border-radius: deprecated.$s-8;
  margin: 0 deprecated.$s-2;

  svg {
    @extend .button-icon;
    stroke: var(--color-foreground-secondary);
  }

  &.selected {
    @extend .button-icon-selected;
  }
}

.toolbar-handler {
  @include deprecated.flexCenter;
  @include deprecated.buttonStyle;
  position: absolute;
  left: 0;
  bottom: 0;
  height: deprecated.$s-12;
  width: 100%;

  .toolbar-handler-btn {
    height: deprecated.$s-4;
    width: 100%;
    max-width: deprecated.$s-64;
    padding: 0;
    border-radius: deprecated.$s-4;
    background-color: var(--palette-handler-background-color);
  }
}

ul.main-toolbar-panels {
  display: none;
}
